Repository navigation
fix(WISEAuthenticationSuccessHandler): Signing in to a closed site redirects to a page that does not exist - #369
Open
Isaries wants to merge 1 commit into
Conversation
…directs to a page that does not exist When sign-in is disabled, a non-administrator who signs in is signed out again and redirected to /pages/maintenance.html, a page that has never existed in this repository. The sign-in page posts the credentials with XHR, follows the redirect, and cannot read the response, so the person is told that the username or password is wrong. The refusal is now a JSON body in the format WISEAuthenticationFailureHandler already uses, with isLoginDisabled set, and the unused LOGIN_DISABLED_MESSGE_PAGE constant is removed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When an administrator disables sign-in (
isLoginAllowed: falsein the portal settings), a teacher or student who signs in with the correct password is told "Username and password not recognized".WISEAuthenticationSuccessHandlersigns the person out again and redirects to/pages/maintenance.html(LOGIN_DISABLED_MESSGE_PAGE), but that page has never existed in this repository. The sign-in page posts the credentials with XHR, follows the redirect, cannot read what comes back, and falls through to the wrong-password message.The effect is that, while the site is closed, people who type the right password are told it is wrong, and may reset passwords or contact their teacher instead of waiting.
Changes
ControllerUtil.createErrorResponse()andisLoginDisabled: true, the same shapeWISEAuthenticationFailureHandleruses forisRecaptchaVerificationFailed.LOGIN_DISABLED_MESSGE_PAGEconstant is removed.The sign-in page needs to recognise
isLoginDisabledto show a message instead of the password error; that is WISE-Client#2381.Test
WISEAuthenticationSuccessHandlerTest: a student signing in to a closed site gets no redirect, a body withstatus: "error"andisLoginDisabled: true, and an empty security context. Against the currentdevelopit fails withexpected: <null> but was: </pages/maintenance.html>.WISEAuthenticationSuccessHandlerTest,WebSecurityConfigAuthorizationTestandLoginControllerTestpass.